< previous page page_531 next page >

Page 531
Chapter 15
Hidden Surface Removal
The hi-lo and Z-order algorithms described in Chapter 14, Surfaces, let you perform hidden surface removal for simple surfaces. They work only for simple surfaces, however, and are not guaranteed to work for perspective projections.
This chapter describes more general hidden surface removal techniques that do not have these limitations. The chapter starts by describing a relatively simple backface removal algorithm. You can use backface removal to perform hidden surface removal for convex solids. Backface removal is also useful as a preprocessing step for hidden surface removal in other solids.
The sections that follow describe the Depth-Sort algorithm. Using Depth-Sort, you can perform hidden surface removal for almost any set of three-dimensional objects.
Backface Removal
Figure 15.1 shows the geometry of a perspective projection of a cube. The side of the cube farthest from the center of projection is hidden by the rest of the cube. Because this face is on the back side as seen from the center of projection, it is called a backface. Because you cannot see a backface from the center of projection, you do not need to draw it. The process of identifying backfaces is called backface removal or culling.
Figure 15.1 shows something very important about backfaces. The line from the center of projection to a backface points in more or less the same direction as a perpendicular vector pointing outward from the face. This vector is called the surface normal.
More precisely, if the viewing direction makes an angle less than 90 degrees with a surface normal, the surface is a backface, so you do not need to draw it. If the line and normal meet at an angle of greater than 90 degrees, the surface is not a backface. If the two meet at exactly 90 degrees, the surface is seen edge on from the center of projection. In that case, the surface appears as a line segment in the projected image. Unless your solid is infinitely thin, the edges of the surface will meet those of other surfaces, some

 
< previous page page_531 next page >